export class HashSet<T> {

    private Set: Set<T>;

    constructor() {
        this.Set = new Set<T>();
        Object.defineProperty(this, "Set", { enumerable: false });
    }

    Add(value: T) {
        this.Set.add(value);
    }

    Remove(value: T) {
        this.Set.delete(value);
    }

    Contains(value: T): boolean {
        return this.Set.has(value);
    }

    Clear() {
        this.Set.clear();
    }

    Size(): number {
        return this.Set.size;
    }

    ToArray(): T[] {
        return Array.from(this.Set.values());
    }

}